﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace MedicalDictionaryVirtualization_0._0210012012.UI
{
	public partial class MainPage : UserControl
	{
		public MainPage()
		{
			// Required to initialize variables
			InitializeComponent();
			App.Current.Host.Content.Resized += new EventHandler(Content_Resized);
		}
		
		void Content_Resized(object sender, EventArgs e)
		{	
			Width = Application.Current.Host.Content.ActualWidth;
			Height = Application.Current.Host.Content.ActualHeight;   			
		}

        private void btnHistory_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            lbAlphabet.Margin = new Thickness(15,191,0,16);
			btnClearAll.Visibility = Visibility.Visible;
			btnDelete.Visibility = Visibility.Visible;
        }

        private void btnSearch_Click(object sender, System.Windows.RoutedEventArgs e)
        {        	
            lbAlphabet.Margin = new Thickness(15,146,0,16);		
			btnClearAll.Visibility = Visibility.Collapsed;
			btnDelete.Visibility = Visibility.Collapsed;
            MessageBox.Show("Ban vua` go~ : " + SearchContent.Text);
        }

        private void acbSearch_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
        	lbAlphabet.Margin = new Thickness(15,146,0,16);		
			btnClearAll.Visibility = Visibility.Collapsed;
			btnDelete.Visibility = Visibility.Collapsed;
        }
	}
}